package org.rambadger.command.command;

import org.axonframework.commandhandling.annotation.TargetAggregateIdentifier;

public abstract class AddUploadedFile {
    final String filename;
    final String fileId;

    protected AddUploadedFile(String filename, String fileId) {
        this.filename = filename;
        this.fileId = fileId;
    }

    public String getFilename() {
        return filename;
    }

    public String getFileId() {
        return fileId;
    }




    public static class AddSubmissionFile extends AddUploadedFile {
        //Compound Key {
        @TargetAggregateIdentifier
        final String username;
        final int submissionId;
        //}


        public AddSubmissionFile(String username, int submissionId, String filename, String fileId) {
            super(filename, fileId);
            this.username = username;
            this.submissionId = submissionId;
        }

        public String getUsername() {
            return username;
        }

        public int getSubmissionId() {
            return submissionId;
        }
    }


    public static class AddAssignmentFile extends AddUploadedFile {
        //Compound Key {
        @TargetAggregateIdentifier
        final String platformId;
        final String assignmentId;
        //}

        public AddAssignmentFile(String platformId, String assignmentId, String filename, String fileId) {
            super(filename, fileId);
            this.platformId = platformId;
            this.assignmentId = assignmentId;
        }

        public String getPlatformId() {
            return platformId;
        }

        public String getAssignmentId() {
            return assignmentId;
        }
    }


    public static class SetUserPortrait extends AddUploadedFile {
        @TargetAggregateIdentifier
        final String username;

        public SetUserPortrait(String username, String filename, String fileId) {
            super(filename, fileId);
            this.username = username;
        }

        public String getUsername() {
            return username;
        }
    }
}
